<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>${(metadata.alias)!} ${site.name}</title>
	<meta name="keywords" content="${(metadata.alias)!} ${site.name}"/>
	<meta name="description" content="${(metadata.alias)!} ${site.name}" />
	<@tools.includePlace path="/common/697054d4-2b69-4476-b4fe-868c61316959.html"/> <#-- header -->
</head>
<body class="d-flex flex-column">
	<main class="flex-shrink-0"  data-diy="config" data-diy-id="site">
		<@tools.includePlace path="/common/0b31f69d-dc03-407b-95af-88be3db0289e.html"/> <#-- nav -->
		<!-- Page Content-->
            <section class="py-5">
				<div class="container px-5 my-5">
					<div class="card bg-light">
						<div class="card-body">
							<#macro message code>${springMacroRequestContext.getMessage(code)}</#macro>
							<#if error?has_content>
								<p class="message red"><@message error/></p>
							<#elseif message?has_content>
								<p class="message"><@message "message."+message/></p>
							<#else>
								<#if user?has_content>
									<p>${user.nickname},您已经登录了<a href="javascript:logout();">点击这里退出登录</a></p>
									<form name="logout" action="${site.dynamicPath}doLogout" method="post">
										<input type="hidden" name="userId" value="${(user.id)!}"/>
										<input type="hidden" name="returnUrl" value="${returnUrl!site.dynamicPath!}"/>
									</form>
									<#if !user.emailChecked>
										<form action="${site.dynamicPath}user/saveEmail" method="post" class="center login-form">
											<input type="hidden" name="_csrf" value="<@tools.csrfToken/>"/>
											<input type="hidden" name="returnUrl" value="${site.dynamicPath}login.html"/>
											<p>
												<input type="email" name="email" placeholder="Email" title="Email" value="${user.email!}"/>
												<input type="submit" value="验证邮箱"/>
											</p>
										</form>
									</#if>
								<#else>
									<form action="${site.dynamicPath}doLogin" method="post">
										<#if error?has_content>
											<p class="red">${springMacroRequestContext.getMessage(error,error)}</p>
										</#if>
										<p><input type="text" name="username" placeholder="用户名" title="用户名"/></p>
										<p><input type="password" name="password" placeholder="密码" title="密码"/></p>
										<@sys.configData code="safe">
											<#if object.captcha?has_content && object.captcha?split(",")?seq_contains("login")>
										<p>
											<input name="captcha" type="text" autocomplete="off" placeholder="验证码" title="验证码"/>
											<img src="${site.dynamicPath}getCaptchaImage?${.now?long}" alt="captcha" onclick="this.src=this.src+'&'+new Date().getTime()"/>
										</p>
											</#if>
										</@sys.configData>
										<p>
											<input type="hidden" name="returnUrl" value="${returnUrl!}"/>
											<input type="hidden" name="clientId" value="${clientId!}"/>
											<input type="hidden" name="uuid" value="${uuid!}"/>
											<input type="submit" value="登录"/>
										</p>
										<#if _oauthList?has_content&&_oauthList?is_directive>
										<div data-diy="config" data-diy-id="oauth">
											<@oauth.list>
												<p><#list list as o><a href="${site.dynamicPath}oauth/login/${o}">使用${o}登录</a><#sep> </#list></p>
											</@oauth.list>
										</div>
										</#if>
										<p>没有账号?<a href="register.html?clientId=${clientId!}&uuid=${uuid!}&returnUrl=${returnUrl!}">请注册</a></p>
									</form>
								</#if>
							</#if>
						</div>
					</div>
				</div>
			</section>
	</main>
	<script>
		var templatePath='${.current_template_name?keep_after('/')}';
	</script>
	<@tools.includePlace path="/common/704bd033-154c-40f4-a8c5-2d36c092c3fd.html"/> <#-- footer -->
	<script src="${site.sitePath}assets/js/jquery-3.6.4.min.js"></script>
	<script>
            function logout(){
				$('form[name=logout]').submit();
			}
	</script>
</body>
</html>
